package com.common.springbootcommonmessage.enums;

import java.util.HashMap;

public enum NotificationType {
    EmailPAIssue(0),
    EmailAddress(1),
    EmailPartsIssue(2),
    EmailAdditionalCharge(3),
    MessagePAIssue(10),
    MessagePartsIssue(12),
    MessageTicketInquery(13),
    MessagePartsQuestion(14),
    RMAReviewingIssue(50),
    RMAApprovedDeniedIssue(51),
    RMAReturningIssue(52),
    RMAGeneralIssue(53),
    RMAMessageIssue(54),
    RMASystemMessage(55);

    private final Integer value;
    private static HashMap<Integer, NotificationType> integerMap = new HashMap<Integer, NotificationType>();
    private static HashMap<String, NotificationType> stringMap = new HashMap<String, NotificationType>();
    private static HashMap<String, Integer> nameMap = new HashMap<String, Integer>();

    NotificationType(Integer value) {
        this.value = value;
    }

    static {
        for (NotificationType status : NotificationType.values()) {
            integerMap.put(status.getValue(), status);
            stringMap.put(status.getValue().toString(), status);
            stringMap.put(status.name().toLowerCase(), status);
            nameMap.put(status.name(), status.getValue());
        }
    }

    public Integer getValue() {
        return this.value;
    }

    public static NotificationType valueOf(Integer value) {
        return (NotificationType) integerMap.get(value);
    }

    public static Integer getTypeByName(String name) {
        return (Integer)nameMap.get(name);
    }

}